money = 5_0000_0000
name = None

name = input("Please your name:")

def query(show_header):
    if show_header:
        print("----------查询余额----------")
        print(f"{name},您好，您的余额剩余:{money}元")



def saving(num):
    global money
    money += num
    print("----------存款余额----------")
    print(f"{name},您好，您存款{money}元成功")
    query(False)

def get_money(num):
    global money
    money -= num
    print("----------存款余额----------")
    print(f"{name},您好，您q取款{money}元成功")
    query(False)

def main():
    print("----------主菜单----------")
    print(f"{name},您好，环境来到ATM。请选择操作:")
    print("查询余额\t【1】")
    print("存款\t【2】")
    print("取款\t【3】")
    print("退出\t【4】")
    return input("请输入你的选择:")

while True:
    keyboard_input = main()
    if keyboard_input == "1":
        query(True)
        continue
    elif keyboard_input == "2":
        num = int(input("您想要存多少钱:"))
        saving(num)
        continue
    elif keyboard_input == "3":
        num = int(input("您想要去多少钱:"))
        get_money(num)
        continue
    else:
        print("程序退出")
        break